package com.hibase.core.excel.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hibase.core.excel.entity.MdsExcelBizDataDetail;
import com.hibase.core.mybatis.registrar.HibaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Excel 业务数据明细表 Mapper
 *
 * @author <a href="mailto:xiongliyi@hichain.com">Ian Xiong</a>
 * @since 1.4.35-V2
 */
public interface MdsExcelBizDataDetailMapper extends HibaseMapper<MdsExcelBizDataDetail> {
    /**
     * 通过导入模板ID查询
     *
     * @param importTemplateId 导入模板Id
     * @param queryWrapper     查询条件
     * @return 业务数据集详情列表
     */
    @Select("SELECT * FROM mds_excel_biz_data_detail where biz_data_id = (SELECT biz_data_id FROM mds_excel_import_config where id= #{impTemplateId,jdbcType=VARCHAR}) ${ew.customSqlSegment}")
    List<MdsExcelBizDataDetail> queryPageByImportId(@Param("impTemplateId") String importTemplateId, @Param("ew") QueryWrapper<MdsExcelBizDataDetail> queryWrapper);
}
